package config

import (
	"fmt"
	redis2 "github.com/redis/go-redis/v9"
	db2 "server/framework/orm/session/db"
	"server/framework/web/session/manager"
	"time"
)

// redis
var rdb = redis2.NewClient(&redis2.Options{
	Addr: "localhost:6379",
})
var TokenDuration = time.Minute * 30
var MG = manager.NewManager(rdb, "user_service", TokenDuration, "zly_token")

// todo: 后面写入持久化存储中
var FileStorage = make(map[string]string, 2)

// 上传文件保存位置

var FileTmpPath = "E:\\goland\\project\\server\\business\\testdata\\tmp_file"
var FileTargetPath = "E:\\goland\\project\\server\\business\\testdata\\file"

// mysql
var (
	Username = "root"
	Password = "123456"
	Ip       = "127.0.0.1"
	Port     = "3306"
	DbName   = "business"
)

var dataSourceName = fmt.Sprint(Username, ":", Password, "@tcp(", Ip, ":", Port, ")/", DbName)
var DB db2.Session = db2.NewDB("mysql", dataSourceName)
